package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.vo.SjOrderHistoryVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SjOrderHistoryMapper;
import com.ruoyi.system.domain.SjOrderHistory;
import com.ruoyi.system.service.ISjOrderHistoryService;

/**
 * 整改下发Service业务层处理
 * 
 * @author zrr
 * @date 2024-11-06
 */
@Service
public class SjOrderHistoryServiceImpl implements ISjOrderHistoryService 
{
    @Autowired
    private SjOrderHistoryMapper sjOrderHistoryMapper;

    /**
     * 查询整改下发
     * 
     * @param id 整改下发主键
     * @return 整改下发
     */
    @Override
    public SjOrderHistory selectSjOrderHistoryById(Integer id)
    {
        return sjOrderHistoryMapper.selectSjOrderHistoryById(id);
    }

    /**
     * 查询整改下发列表
     * 
     * @param sjOrderHistory 整改下发
     * @return 整改下发
     */
    @Override
    public List<SjOrderHistory> selectSjOrderHistoryList(SjOrderHistory sjOrderHistory)
    {
        return sjOrderHistoryMapper.selectSjOrderHistoryList(sjOrderHistory);
    }

    /**
     * 新增整改下发
     * 
     * @param sjOrderHistory 整改下发
     * @return 结果
     */
    @Override
    public int insertSjOrderHistory(SjOrderHistory sjOrderHistory)
    {
        sjOrderHistory.setCreateTime(DateUtils.getNowDate());
        return sjOrderHistoryMapper.insertSjOrderHistory(sjOrderHistory);
    }

    /**
     * 修改整改下发
     * 
     * @param sjOrderHistory 整改下发
     * @return 结果
     */
    @Override
    public int updateSjOrderHistory(SjOrderHistory sjOrderHistory)
    {
        sjOrderHistory.setUpdateTime(DateUtils.getNowDate());
        return sjOrderHistoryMapper.updateSjOrderHistory(sjOrderHistory);
    }

    /**
     * 批量删除整改下发
     * 
     * @param ids 需要删除的整改下发主键
     * @return 结果
     */
    @Override
    public int deleteSjOrderHistoryByIds(Integer[] ids)
    {
        return sjOrderHistoryMapper.deleteSjOrderHistoryByIds(ids);
    }

    /**
     * 删除整改下发信息
     * 
     * @param id 整改下发主键
     * @return 结果
     */
    @Override
    public int deleteSjOrderHistoryById(Integer id)
    {
        return sjOrderHistoryMapper.deleteSjOrderHistoryById(id);
    }

    /**
     * 部门异常分布数量
     * @return
     */
    @Override
    public List<SjOrderHistoryVO> selectSjOrderHistoryCount() {
        return sjOrderHistoryMapper.selectSjOrderHistoryCount();
    }
}
